﻿using UnityEngine;
using System.Collections;

public class Enemy : MonoBehaviour {
	
	public GUIText winText;
	// Use this for initialization
	void Start () {
		winText.text = "";
	}
	
	// Update is called once per frame
	void Update () {
	
	}

	void OnTriggerEnter(Collider other) {
		if (other.gameObject.tag == "Player") {
			rigidbody.velocity = other.gameObject.rigidbody.velocity;
		}
		if (other.gameObject.tag == "Goal") {
			winText.text = "You Win!";
		}
	}
}
